//
//  HSTestOneViewController.m
//  HSToolKit_Example
//
//  Created by huang on 2018/9/29.
//  Copyright © 2018年 772729579@qq.com. All rights reserved.
//

#import "HSTestOneViewController.h"
#import "HSTestTwoViewController.h"
#import "HSTestThreeViewController.h"
#import "HSTestFourViewController.h"
#import "UINavigationBar+Awesome.h"

@interface HSTestOneViewController ()

@end

@implementation HSTestOneViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"TestOne";
    
    UIButton *testButton = [UIButton buttonWithType:UIButtonTypeCustom];
    testButton.frame = CGRectMake(100, 100, 200, 100);
    testButton.backgroundColor = [UIColor colorWithRed:arc4random_uniform(256.0)/256.0f green:arc4random_uniform(256)/256.0f blue:arc4random_uniform(256)/256.0f alpha:1.0f];
    [testButton addTarget:self action:@selector(testButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
    [testButton setTitle:@"TestOne" forState:UIControlStateNormal];
    [self.view addSubview:testButton];
    
    UIButton *testThreeButton = [UIButton buttonWithType:UIButtonTypeCustom];
    testThreeButton.frame = CGRectMake(100, 250, 200, 100);
    testThreeButton.backgroundColor = [UIColor colorWithRed:arc4random_uniform(256.0)/256.0f green:arc4random_uniform(256)/256.0f blue:arc4random_uniform(256)/256.0f alpha:1.0f];
    [testThreeButton addTarget:self action:@selector(testThreeButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
    [testThreeButton setTitle:@"TestThree" forState:UIControlStateNormal];
    [self.view addSubview:testThreeButton];
    
    UIButton *testFourButton = [UIButton buttonWithType:UIButtonTypeCustom];
    testFourButton.frame = CGRectMake(100, 400, 200, 100);
    testFourButton.backgroundColor = [UIColor colorWithRed:arc4random_uniform(256.0)/256.0f green:arc4random_uniform(256)/256.0f blue:arc4random_uniform(256)/256.0f alpha:1.0f];
    [testFourButton addTarget:self action:@selector(testFourButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
    [testFourButton setTitle:@"TestFour" forState:UIControlStateNormal];
    [self.view addSubview:testFourButton];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    [self.navigationController.navigationBar hs_setBackgroundColor:[UIColor whiteColor]];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];

    [self.navigationController.navigationBar hs_reset];
}

- (void)testButtonClicked:(UIButton *)sender
{
    HSTestTwoViewController *test = [[HSTestTwoViewController alloc] init];
    [self.navigationController pushViewController:test animated:YES];
}

- (void)testThreeButtonClicked:(UIButton *)sender
{
    HSTestThreeViewController *test = [[HSTestThreeViewController alloc] init];
    [self.navigationController pushViewController:test animated:YES];
}

- (void)testFourButtonClicked:(UIButton *)sender
{
    HSTestFourViewController *test = [[HSTestFourViewController alloc] init];
    [self.navigationController pushViewController:test animated:YES];
}



@end
